using QFramework.Framework;
using QFramework.Framework.Manager;
using UnityEditor;
using UnityEngine;

namespace QFramework.Example._4.GUIManager
{
    public class GUIExample : MonoBehaviourSimplify
    {
        private void Start()
        {
            Framework.Manager.GUIManager.SetResolution(1280, 720, 0);

            Framework.Manager.GUIManager.LoadPanel("HomePanel", UILayer.Common);

            Delay(3.0f, () => { Framework.Manager.GUIManager.UnLoadPanel("HomePanel"); });
        }

#if UNITY_EDITOR
        [MenuItem("QFramework/Example/4.GUIManager", false, 4)]
        private static void MenuClicked()
        {
            EditorApplication.isPlaying = true;
            new GameObject("GUIExample").AddComponent<GUIExample>();
        }
#endif

        protected override void OnBeforeDestroy()
        {
        }
    }
}